package cn.edu.pku.ss.situationawareperceiver;

import org.alljoyn.bus.annotation.Position;
import org.alljoyn.bus.annotation.Signature;

public class ContextShareRequest {
	/**
	 * This class defines the data structure of the context request message.
	 * 
	 * Through bus object this message will be delivered to all the peers in the 'contextsharing' session. 
	 * Handlers in ContextSharingService will handle this kind of request when it received one.
	 * 
	 */
	@Position(0)
	@Signature("s")
	public String senderPeerId;
	
	@Position(1)
	@Signature("n")
	public int contextTypeInt;
	
	@Position(2)
	@Signature("t")
	public long requestTime;
	
	@Position(3)
	@Signature("i")
	public int expirePeriod;	//seconds
	
	public void initialize(String senderPeerId,
			int contextTypeInt, long requestTime, int expirePeriod) {
		this.senderPeerId = senderPeerId;
		this.contextTypeInt = contextTypeInt;
		this.requestTime = requestTime;
		this.expirePeriod = expirePeriod;
	}
}
